package com.fulihui.wgj.config;

import com.fulihui.common.util.JedisUtil;
import com.fulihui.common.util.TemplateMsgCancelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import redis.clients.jedis.JedisPool;

/**
 * jedis工具类初始化
 *
 * @author: Levon
 * @date: 2018-06-20 17:14
 */
@Configuration
public class JedisUtilConfig {

    @Autowired
    JedisPool jedisPool;

    @Bean
    public JedisUtil jedisUtil() {
        JedisUtil jedisUtil = new JedisUtil();
        jedisUtil.setJedisPool(jedisPool);
        return jedisUtil;
    }

    @Bean
    public TemplateMsgCancelUtil templateMsgCancelUtil(JedisUtil jedisUtil){
        return new TemplateMsgCancelUtil(jedisUtil);
    }
}
